﻿using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Bornander.UI;

namespace MiniGOQO
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void menuItem3_Click(object sender, EventArgs e)//注册
        {
            RegisterForm rf = new RegisterForm();
            rf.Show();
        }

        private void menuItem4_Click(object sender, EventArgs e)//登录
        {
            if (EmailtextBox.Text.Trim() == "") {
                MessageBox.Show("请输入Email账号！");
                return;
            }
            else if (PWtextBox.Text.Trim() == "") {
                MessageBox.Show("请输入密码！");
                return;
            }
            if (XMLutil.Login(EmailtextBox.Text.Trim(), PWtextBox.Text.Trim()) != null)
            {
                MainForm mf = new MainForm();
                mf.Show();
                this.Hide();
            }
            else {
                MessageBox.Show("Email账号或密码错误，请重新输入！");
            }
        }

        private void menuItem2_Click(object sender, EventArgs e)//退出
        {
            this.Dispose();
        }
    }
}